package com.mixsmart.utils;

import com.mixsmart.utils.StringUtils;

public class StringUtilsMain {

	public static void main(String[] args) {
		System.out.println(StringUtils.uuid().toUpperCase());
		System.out.println(System.currentTimeMillis());
		System.out.println(System.nanoTime());
		System.out.println(StringUtils.createSerialNum());
		int num = 10000;
		String[] array = new String[num]; 
		for (int i = 0; i < num; i++) {
			array[i] = StringUtils.uuid();
		}
		if(isReapt(array)) {
			System.out.println("有重复数据");
		} else {
			System.out.println("无重复数据");
		}
	}
	
	private static boolean isReapt(String[] array) {
		boolean is = false;
		for (int i = 0; i < array.length; i++) {
			for (int j = i+1; j < array.length; j++) {
				if(array[i].equals(array[j])) {
					is = true;
					break;
				}
			}
			if(is){
				break;
			}
		}
		return is;
	}

}
